<%@page import="POJO.DanhMuc"%>
<%@page import="org.apache.jasper.tagplugins.jstl.core.ForEach"%>
<%@page import="DAO.SanPhamDAO"%>
<%@page import="POJO.SanPham"%>
<%@page import="java.util.ArrayList"%>
<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<%
    if (request.getAttribute("id") != null)
    {
        String id = (String) request.getAttribute("id");
        if (id.equals("2"))
        {
            ArrayList<SanPham> listsanPham = (ArrayList<SanPham>) request.getAttribute("listSanPham");            
%>

<!-- Container -->
<div id="container">
	<div class="shell">

		<!-- Small Nav -->
		<div class="small-nav">
			<a href="#">Sản phẩm</a> <span>&gt;</span> Chi tiết sản phẩm
		</div>
		<!-- End Small Nav -->

		<!-- Main -->
		<div id="main">
			<div class="cl">&nbsp;</div>

			<!-- Content -->
			<div id="content">

				<!-- Box -->
				<div class="box">
					<!-- Box Head -->
					<div class="box-head">
						<h2 class="left">Thông tin chi tiết</h2>
						<div class="right">
						<form action="SanPham" method="post">
							<label>Tìm kiếm</label> <input type="text" class="field small-field" name="timKiem" /> <input type="submit" class="button" value="Tìm"/>
							</form>
						</div>
					</div>
					<!-- End Box Head -->

					<!-- Table -->
					<div class="table">
						<table width="100%" border="0" cellspacing="0" cellpadding="0">
							<tr>
								<th width="60">Mã sản phẩm</th>
								<th>Tên sản phẩm</th>
								<th>Tình trạng</th>
								<th width="110" class="ac">Content Control</th>
							</tr>
							<%
							    for (SanPham sanPham : listsanPham)
							            {
							        %>
							                <tr>
							                <th><%= sanPham.getMaSanPham()%> </th>
							                <th><%= sanPham.getTenSanPham()%> </th>
							                <th><%= sanPham.getTinhTrang()%> </th>
							                <th>
														<a href="XoaSanPham?maSanPham=<%= sanPham.getMaSanPham() %>" class="ico del" onclick="">Delete</a>
														<a href="SuaSanPham?maSanPham=<%= sanPham.getMaSanPham() %>" class="ico edit">Edit</a>
							                </th>
							                </tr>
							       <%
							            }
							%>
						</table>
					</div>
					<!-- Table -->
				</div>
				<!-- End Box -->
			</div>
			<!-- End Content -->

			<!-- Sidebar -->
			<div id="sidebar">

				<!-- Box -->
				<div class="box">

					<!-- Box Head -->
					<div class="box-head">
						<h2>Quản lý</h2>
					</div>
					<!-- End Box Head-->

					<div class="box-content">
						<a href="ThemSanPham" class="add-button"><span>Thêm sản phẩm</span></a>
						<div class="cl">&nbsp;</div>
						
						<!-- Sort -->
						<!-- End Sort -->
					</div>
				</div>
				<!-- End Box -->
			</div>
			<!-- End Sidebar -->

			<div class="cl">&nbsp;</div>
		</div>
		<!-- Main -->
	</div>
</div>
<!-- End Container -->
<%
    }

    }
%>
